$(document).ready(function() {
    $.ajax({
        url: "/mall/admin/classification/findtwotype.do",
        type:'post',
        async : false, //默认为true 异步
        dataType : 'json',
        error:function(data){
        },
        success:function(result){
            if (result.state == 0) {
                var list = $("#chanpinkuai");
                list.html("");
                $(result.data).each(function (index, item) {
                    var cat1 = $('<div class="tb_box"></div>');
                    var cat2 = $('<h2 class="tab_tit"><a class="more" href="/mall/product/category_list.html?csid='+item.id+'">更多</a>'+item.cname+'</h2>');
                    var cat3 = $('<div class="tb_type tb_type_even clearfix"> </div>');
                    $.get("/mall/product/cengjihotlist.do?type="+item.id, function (data1) {
                         if (data1.state == 0) {
                             $(data1.data).each(function (index1, item1) {
                                 var cat = $('<a class="tb_floor" href="/mall/product/getpro.do?id='+item1.id+'"> <img src="'+ item1.image +'" style="width:100%;"> </a>');
                                 cat3.append(cat);
                             })
                         }
                     });
                    cat1.append(cat2);
                    cat1.append(cat3);
                    list.append(cat1);
                });
            }
        }
    });


});





